using System.Web.UI;
using System.Web.UI.HtmlControls;

namespace FluentTags
{

    public class LITag : Tag<LITag>
    {
        public LITag() : base("li"){}
        
        public LITag(string text) : this()
        {
            Controls.Add(new LiteralControl(text));
        }

        public LITag(object value) : this()
        {
            Controls.Add(new LiteralControl(SafeString(value)));
        }
        
        
        public LITag(Control control) : this()
        {
            Controls.Add(control);
        }
        
        
        
        
        public ATag<LITag> A()
        {
            var ctrl = new ATag<LITag>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public LITag A(ATag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public ATag<LITag> A(string text)
        {
            var ctrl = new ATag<LITag>(this);
            Controls.Add(ctrl);
            LiteralControl lc = new LiteralControl(text);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public ATag<LITag> A(Control control)
        {
            var ctrl = new ATag<LITag>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public ATag<LITag> A(object value)
        {
            return A(SafeString(value));
        }
        
        public BTag<LITag> B()
        {
            var ctrl = new BTag<LITag>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public LITag B(BTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public BTag<LITag> B(string text)
        {
            var ctrl = new BTag<LITag>(this);
            Controls.Add(ctrl);
            LiteralControl lc = new LiteralControl(text);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public BTag<LITag> B(Control control)
        {
            var ctrl = new BTag<LITag>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public BTag<LITag> B(object value)
        {
            return B(SafeString(value));
        }
        
        public BlockquoteTag<LITag> Blockquote()
        {
            var ctrl = new BlockquoteTag<LITag>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public LITag Blockquote(BlockquoteTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public BlockquoteTag<LITag> Blockquote(string text)
        {
            var ctrl = new BlockquoteTag<LITag>(this);
            Controls.Add(ctrl);
            LiteralControl lc = new LiteralControl(text);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public BlockquoteTag<LITag> Blockquote(Control control)
        {
            var ctrl = new BlockquoteTag<LITag>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public BlockquoteTag<LITag> Blockquote(object value)
        {
            return Blockquote(SafeString(value));
        }
        
        public BRTag<LITag> BR()
        {
            var ctrl = new BRTag<LITag>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public LITag BR(BRTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public DivTag<LITag> Div()
        {
            var ctrl = new DivTag<LITag>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public LITag Div(DivTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public DivTag<LITag> Div(string text)
        {
            var ctrl = new DivTag<LITag>(this);
            Controls.Add(ctrl);
            LiteralControl lc = new LiteralControl(text);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public DivTag<LITag> Div(Control control)
        {
            var ctrl = new DivTag<LITag>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public DivTag<LITag> Div(object value)
        {
            return Div(SafeString(value));
        }
        
        public EMTag<LITag> EM()
        {
            var ctrl = new EMTag<LITag>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public LITag EM(EMTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public EMTag<LITag> EM(string text)
        {
            var ctrl = new EMTag<LITag>(this);
            Controls.Add(ctrl);
            LiteralControl lc = new LiteralControl(text);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public EMTag<LITag> EM(Control control)
        {
            var ctrl = new EMTag<LITag>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public EMTag<LITag> EM(object value)
        {
            return EM(SafeString(value));
        }
        
        public H1Tag<LITag> H1()
        {
            var ctrl = new H1Tag<LITag>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public LITag H1(H1Tag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public H1Tag<LITag> H1(string text)
        {
            var ctrl = new H1Tag<LITag>(this);
            Controls.Add(ctrl);
            LiteralControl lc = new LiteralControl(text);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public H1Tag<LITag> H1(Control control)
        {
            var ctrl = new H1Tag<LITag>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public H1Tag<LITag> H1(object value)
        {
            return H1(SafeString(value));
        }
        
        public H2Tag<LITag> H2()
        {
            var ctrl = new H2Tag<LITag>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public LITag H2(H2Tag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public H2Tag<LITag> H2(string text)
        {
            var ctrl = new H2Tag<LITag>(this);
            Controls.Add(ctrl);
            LiteralControl lc = new LiteralControl(text);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public H2Tag<LITag> H2(Control control)
        {
            var ctrl = new H2Tag<LITag>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public H2Tag<LITag> H2(object value)
        {
            return H2(SafeString(value));
        }
        
        public H3Tag<LITag> H3()
        {
            var ctrl = new H3Tag<LITag>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public LITag H3(H3Tag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public H3Tag<LITag> H3(string text)
        {
            var ctrl = new H3Tag<LITag>(this);
            Controls.Add(ctrl);
            LiteralControl lc = new LiteralControl(text);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public H3Tag<LITag> H3(Control control)
        {
            var ctrl = new H3Tag<LITag>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public H3Tag<LITag> H3(object value)
        {
            return H3(SafeString(value));
        }
        
        public H4Tag<LITag> H4()
        {
            var ctrl = new H4Tag<LITag>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public LITag H4(H4Tag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public H4Tag<LITag> H4(string text)
        {
            var ctrl = new H4Tag<LITag>(this);
            Controls.Add(ctrl);
            LiteralControl lc = new LiteralControl(text);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public H4Tag<LITag> H4(Control control)
        {
            var ctrl = new H4Tag<LITag>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public H4Tag<LITag> H4(object value)
        {
            return H4(SafeString(value));
        }
        
        public H5Tag<LITag> H5()
        {
            var ctrl = new H5Tag<LITag>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public LITag H5(H5Tag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public H5Tag<LITag> H5(string text)
        {
            var ctrl = new H5Tag<LITag>(this);
            Controls.Add(ctrl);
            LiteralControl lc = new LiteralControl(text);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public H5Tag<LITag> H5(Control control)
        {
            var ctrl = new H5Tag<LITag>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public H5Tag<LITag> H5(object value)
        {
            return H5(SafeString(value));
        }
        
        public H6Tag<LITag> H6()
        {
            var ctrl = new H6Tag<LITag>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public LITag H6(H6Tag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public H6Tag<LITag> H6(string text)
        {
            var ctrl = new H6Tag<LITag>(this);
            Controls.Add(ctrl);
            LiteralControl lc = new LiteralControl(text);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public H6Tag<LITag> H6(Control control)
        {
            var ctrl = new H6Tag<LITag>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public H6Tag<LITag> H6(object value)
        {
            return H6(SafeString(value));
        }
        
        public HRTag<LITag> HR()
        {
            var ctrl = new HRTag<LITag>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public LITag HR(HRTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public ITag<LITag> I()
        {
            var ctrl = new ITag<LITag>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public LITag I(ITag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public ITag<LITag> I(string text)
        {
            var ctrl = new ITag<LITag>(this);
            Controls.Add(ctrl);
            LiteralControl lc = new LiteralControl(text);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public ITag<LITag> I(Control control)
        {
            var ctrl = new ITag<LITag>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public ITag<LITag> I(object value)
        {
            return I(SafeString(value));
        }
        
        public ImgTag<LITag> Img()
        {
            var ctrl = new ImgTag<LITag>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public LITag Img(ImgTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public OLTag<LITag> OL()
        {
            var ctrl = new OLTag<LITag>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public LITag OL(OLTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public PTag<LITag> P()
        {
            var ctrl = new PTag<LITag>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public LITag P(PTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public PTag<LITag> P(string text)
        {
            var ctrl = new PTag<LITag>(this);
            Controls.Add(ctrl);
            LiteralControl lc = new LiteralControl(text);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public PTag<LITag> P(Control control)
        {
            var ctrl = new PTag<LITag>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public PTag<LITag> P(object value)
        {
            return P(SafeString(value));
        }
        
        public PreTag<LITag> Pre()
        {
            var ctrl = new PreTag<LITag>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public LITag Pre(PreTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public PreTag<LITag> Pre(string text)
        {
            var ctrl = new PreTag<LITag>(this);
            Controls.Add(ctrl);
            LiteralControl lc = new LiteralControl(text);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public PreTag<LITag> Pre(Control control)
        {
            var ctrl = new PreTag<LITag>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public PreTag<LITag> Pre(object value)
        {
            return Pre(SafeString(value));
        }
        
        public SpanTag<LITag> Span()
        {
            var ctrl = new SpanTag<LITag>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public LITag Span(SpanTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public SpanTag<LITag> Span(string text)
        {
            var ctrl = new SpanTag<LITag>(this);
            Controls.Add(ctrl);
            LiteralControl lc = new LiteralControl(text);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public SpanTag<LITag> Span(Control control)
        {
            var ctrl = new SpanTag<LITag>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public SpanTag<LITag> Span(object value)
        {
            return Span(SafeString(value));
        }
        
        public StrongTag<LITag> Strong()
        {
            var ctrl = new StrongTag<LITag>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public LITag Strong(StrongTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public StrongTag<LITag> Strong(string text)
        {
            var ctrl = new StrongTag<LITag>(this);
            Controls.Add(ctrl);
            LiteralControl lc = new LiteralControl(text);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public StrongTag<LITag> Strong(Control control)
        {
            var ctrl = new StrongTag<LITag>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public StrongTag<LITag> Strong(object value)
        {
            return Strong(SafeString(value));
        }
        
        public SubTag<LITag> Sub()
        {
            var ctrl = new SubTag<LITag>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public LITag Sub(SubTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public SubTag<LITag> Sub(string text)
        {
            var ctrl = new SubTag<LITag>(this);
            Controls.Add(ctrl);
            LiteralControl lc = new LiteralControl(text);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public SubTag<LITag> Sub(Control control)
        {
            var ctrl = new SubTag<LITag>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public SubTag<LITag> Sub(object value)
        {
            return Sub(SafeString(value));
        }
        
        public SupTag<LITag> Sup()
        {
            var ctrl = new SupTag<LITag>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public LITag Sup(SupTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public SupTag<LITag> Sup(string text)
        {
            var ctrl = new SupTag<LITag>(this);
            Controls.Add(ctrl);
            LiteralControl lc = new LiteralControl(text);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public SupTag<LITag> Sup(Control control)
        {
            var ctrl = new SupTag<LITag>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public SupTag<LITag> Sup(object value)
        {
            return Sup(SafeString(value));
        }
        
        public TableTag<LITag> Table()
        {
            var ctrl = new TableTag<LITag>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public LITag Table(TableTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public ULTag<LITag> UL()
        {
            var ctrl = new ULTag<LITag>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public LITag UL(ULTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        
        public LITag Text(string text)
        {
            Controls.Add(new LiteralControl(text));
            return this;
        }

        public LITag Text(object value)
        {
            Controls.Add(new LiteralControl(SafeString(value)));
            return this;
        }
        
    }

    public class LITag<ParentType> : ChildTag<LITag<ParentType>, ParentType>
        where ParentType : HtmlGenericControl
    {
        public LITag(ParentType parent) : base("li", parent) { }

        
        
        
        public ATag<LITag<ParentType>> A()
        {
            var ctrl = new ATag<LITag<ParentType>>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public LITag<ParentType> A(ATag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public ATag<LITag<ParentType>> A(string text)
        {
            var ctrl = new ATag<LITag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(text);
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public ATag<LITag<ParentType>> A(Control control)
        {
            var ctrl = new ATag<LITag<ParentType>>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public ATag<LITag<ParentType>> A(object value)
        {
            var ctrl = new ATag<LITag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(SafeString(value));
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            return ctrl;
        }
        
        public BTag<LITag<ParentType>> B()
        {
            var ctrl = new BTag<LITag<ParentType>>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public LITag<ParentType> B(BTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public BTag<LITag<ParentType>> B(string text)
        {
            var ctrl = new BTag<LITag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(text);
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public BTag<LITag<ParentType>> B(Control control)
        {
            var ctrl = new BTag<LITag<ParentType>>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public BTag<LITag<ParentType>> B(object value)
        {
            var ctrl = new BTag<LITag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(SafeString(value));
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            return ctrl;
        }
        
        public BlockquoteTag<LITag<ParentType>> Blockquote()
        {
            var ctrl = new BlockquoteTag<LITag<ParentType>>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public LITag<ParentType> Blockquote(BlockquoteTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public BlockquoteTag<LITag<ParentType>> Blockquote(string text)
        {
            var ctrl = new BlockquoteTag<LITag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(text);
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public BlockquoteTag<LITag<ParentType>> Blockquote(Control control)
        {
            var ctrl = new BlockquoteTag<LITag<ParentType>>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public BlockquoteTag<LITag<ParentType>> Blockquote(object value)
        {
            var ctrl = new BlockquoteTag<LITag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(SafeString(value));
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            return ctrl;
        }
        
        public BRTag<LITag<ParentType>> BR()
        {
            var ctrl = new BRTag<LITag<ParentType>>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public LITag<ParentType> BR(BRTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public DivTag<LITag<ParentType>> Div()
        {
            var ctrl = new DivTag<LITag<ParentType>>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public LITag<ParentType> Div(DivTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public DivTag<LITag<ParentType>> Div(string text)
        {
            var ctrl = new DivTag<LITag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(text);
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public DivTag<LITag<ParentType>> Div(Control control)
        {
            var ctrl = new DivTag<LITag<ParentType>>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public DivTag<LITag<ParentType>> Div(object value)
        {
            var ctrl = new DivTag<LITag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(SafeString(value));
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            return ctrl;
        }
        
        public EMTag<LITag<ParentType>> EM()
        {
            var ctrl = new EMTag<LITag<ParentType>>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public LITag<ParentType> EM(EMTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public EMTag<LITag<ParentType>> EM(string text)
        {
            var ctrl = new EMTag<LITag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(text);
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public EMTag<LITag<ParentType>> EM(Control control)
        {
            var ctrl = new EMTag<LITag<ParentType>>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public EMTag<LITag<ParentType>> EM(object value)
        {
            var ctrl = new EMTag<LITag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(SafeString(value));
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            return ctrl;
        }
        
        public H1Tag<LITag<ParentType>> H1()
        {
            var ctrl = new H1Tag<LITag<ParentType>>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public LITag<ParentType> H1(H1Tag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public H1Tag<LITag<ParentType>> H1(string text)
        {
            var ctrl = new H1Tag<LITag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(text);
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public H1Tag<LITag<ParentType>> H1(Control control)
        {
            var ctrl = new H1Tag<LITag<ParentType>>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public H1Tag<LITag<ParentType>> H1(object value)
        {
            var ctrl = new H1Tag<LITag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(SafeString(value));
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            return ctrl;
        }
        
        public H2Tag<LITag<ParentType>> H2()
        {
            var ctrl = new H2Tag<LITag<ParentType>>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public LITag<ParentType> H2(H2Tag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public H2Tag<LITag<ParentType>> H2(string text)
        {
            var ctrl = new H2Tag<LITag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(text);
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public H2Tag<LITag<ParentType>> H2(Control control)
        {
            var ctrl = new H2Tag<LITag<ParentType>>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public H2Tag<LITag<ParentType>> H2(object value)
        {
            var ctrl = new H2Tag<LITag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(SafeString(value));
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            return ctrl;
        }
        
        public H3Tag<LITag<ParentType>> H3()
        {
            var ctrl = new H3Tag<LITag<ParentType>>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public LITag<ParentType> H3(H3Tag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public H3Tag<LITag<ParentType>> H3(string text)
        {
            var ctrl = new H3Tag<LITag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(text);
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public H3Tag<LITag<ParentType>> H3(Control control)
        {
            var ctrl = new H3Tag<LITag<ParentType>>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public H3Tag<LITag<ParentType>> H3(object value)
        {
            var ctrl = new H3Tag<LITag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(SafeString(value));
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            return ctrl;
        }
        
        public H4Tag<LITag<ParentType>> H4()
        {
            var ctrl = new H4Tag<LITag<ParentType>>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public LITag<ParentType> H4(H4Tag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public H4Tag<LITag<ParentType>> H4(string text)
        {
            var ctrl = new H4Tag<LITag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(text);
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public H4Tag<LITag<ParentType>> H4(Control control)
        {
            var ctrl = new H4Tag<LITag<ParentType>>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public H4Tag<LITag<ParentType>> H4(object value)
        {
            var ctrl = new H4Tag<LITag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(SafeString(value));
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            return ctrl;
        }
        
        public H5Tag<LITag<ParentType>> H5()
        {
            var ctrl = new H5Tag<LITag<ParentType>>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public LITag<ParentType> H5(H5Tag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public H5Tag<LITag<ParentType>> H5(string text)
        {
            var ctrl = new H5Tag<LITag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(text);
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public H5Tag<LITag<ParentType>> H5(Control control)
        {
            var ctrl = new H5Tag<LITag<ParentType>>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public H5Tag<LITag<ParentType>> H5(object value)
        {
            var ctrl = new H5Tag<LITag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(SafeString(value));
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            return ctrl;
        }
        
        public H6Tag<LITag<ParentType>> H6()
        {
            var ctrl = new H6Tag<LITag<ParentType>>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public LITag<ParentType> H6(H6Tag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public H6Tag<LITag<ParentType>> H6(string text)
        {
            var ctrl = new H6Tag<LITag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(text);
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public H6Tag<LITag<ParentType>> H6(Control control)
        {
            var ctrl = new H6Tag<LITag<ParentType>>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public H6Tag<LITag<ParentType>> H6(object value)
        {
            var ctrl = new H6Tag<LITag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(SafeString(value));
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            return ctrl;
        }
        
        public HRTag<LITag<ParentType>> HR()
        {
            var ctrl = new HRTag<LITag<ParentType>>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public LITag<ParentType> HR(HRTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public ITag<LITag<ParentType>> I()
        {
            var ctrl = new ITag<LITag<ParentType>>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public LITag<ParentType> I(ITag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public ITag<LITag<ParentType>> I(string text)
        {
            var ctrl = new ITag<LITag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(text);
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public ITag<LITag<ParentType>> I(Control control)
        {
            var ctrl = new ITag<LITag<ParentType>>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public ITag<LITag<ParentType>> I(object value)
        {
            var ctrl = new ITag<LITag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(SafeString(value));
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            return ctrl;
        }
        
        public ImgTag<LITag<ParentType>> Img()
        {
            var ctrl = new ImgTag<LITag<ParentType>>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public LITag<ParentType> Img(ImgTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public OLTag<LITag<ParentType>> OL()
        {
            var ctrl = new OLTag<LITag<ParentType>>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public LITag<ParentType> OL(OLTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public PTag<LITag<ParentType>> P()
        {
            var ctrl = new PTag<LITag<ParentType>>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public LITag<ParentType> P(PTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public PTag<LITag<ParentType>> P(string text)
        {
            var ctrl = new PTag<LITag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(text);
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public PTag<LITag<ParentType>> P(Control control)
        {
            var ctrl = new PTag<LITag<ParentType>>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public PTag<LITag<ParentType>> P(object value)
        {
            var ctrl = new PTag<LITag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(SafeString(value));
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            return ctrl;
        }
        
        public PreTag<LITag<ParentType>> Pre()
        {
            var ctrl = new PreTag<LITag<ParentType>>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public LITag<ParentType> Pre(PreTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public PreTag<LITag<ParentType>> Pre(string text)
        {
            var ctrl = new PreTag<LITag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(text);
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public PreTag<LITag<ParentType>> Pre(Control control)
        {
            var ctrl = new PreTag<LITag<ParentType>>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public PreTag<LITag<ParentType>> Pre(object value)
        {
            var ctrl = new PreTag<LITag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(SafeString(value));
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            return ctrl;
        }
        
        public SpanTag<LITag<ParentType>> Span()
        {
            var ctrl = new SpanTag<LITag<ParentType>>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public LITag<ParentType> Span(SpanTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public SpanTag<LITag<ParentType>> Span(string text)
        {
            var ctrl = new SpanTag<LITag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(text);
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public SpanTag<LITag<ParentType>> Span(Control control)
        {
            var ctrl = new SpanTag<LITag<ParentType>>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public SpanTag<LITag<ParentType>> Span(object value)
        {
            var ctrl = new SpanTag<LITag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(SafeString(value));
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            return ctrl;
        }
        
        public StrongTag<LITag<ParentType>> Strong()
        {
            var ctrl = new StrongTag<LITag<ParentType>>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public LITag<ParentType> Strong(StrongTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public StrongTag<LITag<ParentType>> Strong(string text)
        {
            var ctrl = new StrongTag<LITag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(text);
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public StrongTag<LITag<ParentType>> Strong(Control control)
        {
            var ctrl = new StrongTag<LITag<ParentType>>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public StrongTag<LITag<ParentType>> Strong(object value)
        {
            var ctrl = new StrongTag<LITag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(SafeString(value));
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            return ctrl;
        }
        
        public SubTag<LITag<ParentType>> Sub()
        {
            var ctrl = new SubTag<LITag<ParentType>>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public LITag<ParentType> Sub(SubTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public SubTag<LITag<ParentType>> Sub(string text)
        {
            var ctrl = new SubTag<LITag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(text);
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public SubTag<LITag<ParentType>> Sub(Control control)
        {
            var ctrl = new SubTag<LITag<ParentType>>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public SubTag<LITag<ParentType>> Sub(object value)
        {
            var ctrl = new SubTag<LITag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(SafeString(value));
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            return ctrl;
        }
        
        public SupTag<LITag<ParentType>> Sup()
        {
            var ctrl = new SupTag<LITag<ParentType>>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public LITag<ParentType> Sup(SupTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public SupTag<LITag<ParentType>> Sup(string text)
        {
            var ctrl = new SupTag<LITag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(text);
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public SupTag<LITag<ParentType>> Sup(Control control)
        {
            var ctrl = new SupTag<LITag<ParentType>>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public SupTag<LITag<ParentType>> Sup(object value)
        {
            var ctrl = new SupTag<LITag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(SafeString(value));
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            return ctrl;
        }
        
        public TableTag<LITag<ParentType>> Table()
        {
            var ctrl = new TableTag<LITag<ParentType>>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public LITag<ParentType> Table(TableTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public ULTag<LITag<ParentType>> UL()
        {
            var ctrl = new ULTag<LITag<ParentType>>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public LITag<ParentType> UL(ULTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        
        public LITag<ParentType> Text(string text)
        {
            Controls.Add(new LiteralControl(text));
            return this;
        }
        
        public LITag<ParentType> Text(object value)
        {
            Controls.Add(new LiteralControl(SafeString(value)));
            return this;
        }
        
        
    }
}